\hypertarget{api_8h}{
\section{api.h文件参考}
\label{api_8h}\index{api.h@{api.h}}
}


EasyIO-\/GPRS 接口文件.  


{\ttfamily \#include \char`\"{}api\_\-type.h\char`\"{}}\par
\subsection*{宏定义}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{api_8h_a80a290edcdf5934b2bbda8eada5c3a52}{HOOK}
\item 
\#define \hyperlink{api_8h_aefb2aa75be4323fe06eb3ec8394bdfc7}{INTERFACE}~extern
\item 
\#define \hyperlink{api_8h_afabb8cdc9450ec537c0bee641a9fda90}{EI\_\-MALLOC}~rt\_\-malloc
\item 
\#define \hyperlink{api_8h_a0044eb38af0014e6521a14a72d05a2f5}{EI\_\-FREE}~rt\_\-free
\end{DoxyCompactItemize}
\subsection*{函数}
\begin{DoxyCompactItemize}
\item 
INTERFACE int \hyperlink{api_8h_a59df66cde845e58fbcce79eafb42b5ee}{ReadSerial} (unsigned char $\ast$buffer, int max, int timeout)
\item 
INTERFACE int \hyperlink{api_8h_a78cc5c993ce3e0c72ddc38c7de1b6d83}{SerialPrintf} (char $\ast$fmt,...)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a1a7008f48872b20f41bd83290e4705e5}{WriteSerial} (unsigned char $\ast$buffer, int size)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_acfa681e48122da0da490adb8b19d8ece}{ReadEEPROM} (int pos, unsigned char $\ast$buffer, int size)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a59935c90d54edd81607ba01ed7d02957}{WriteEEPROM} (int pos, unsigned char $\ast$buffer, int size)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a66cebdf06835f6d6b9c7ec77d84f7099}{GetLocation} ()
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a7f277cbc25c344a82fb50c809fb3ca3b}{SendSms} (const char $\ast$phonenum, const char $\ast$body)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a4c362ba910ffadc54d3d7b0d95bf9b94}{SendTcpData} (const char $\ast$buffer, int size)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a6f4a24bbde5f08822dacb0e5fca2acae}{SendP2paMsg} (const char $\ast$imei, const char $\ast$body)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a1b26a329aa3aa5e962809722a37e21f6}{SendXmppMsg} (const char $\ast$to, const char $\ast$body)
\item 
INTERFACE int \hyperlink{api_8h_acb3f64b85678bbeaad49e856e894d6ad}{HttpRequest} (const char $\ast$url, const char $\ast$UserHeader, char $\ast$RespBuffer, int RespBufSize)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a3821ab5f141aaa49aa7da5f8caf3e580}{GetSysInfo} (struct \hyperlink{structSysInfo}{SysInfo} $\ast$info)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a2a69f03277a975ab59fb363b54e8942c}{ResetSystem} ()
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a0e1c8e962bd88c2df5fb6a54865545a6}{ResetGprs} ()
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a4b93413c1716a933b70ff024609531f9}{InitSerial} (struct \hyperlink{structSerialOption}{SerialOption} $\ast$option)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a009e64f475ff55b9627e9705d8d3c590}{InitDtu} (struct \hyperlink{structDtuOption}{DtuOption} $\ast$option)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a6c87ac370cc3c561d7bc5fc4527dc627}{InitXmpp} (struct \hyperlink{structXmppOption}{XmppOption} $\ast$option)
\item 
INTERFACE EIResult\_\-t \hyperlink{api_8h_a5ab96a061e08adee4a93aca4e050257c}{InitEasyIOCloud} ()
\item 
void \hyperlink{api_8h_a951592d1b14d7bebd76b61fa3f670b88}{InitBoard} ()
\item 
void \hyperlink{api_8h_a567fcfb601dc83cc9691ce515ce5a474}{Startup} ()
\item 
void \hyperlink{api_8h_a153a5fd8946b6ab9fd9b725759fffe5e}{MainLoop} ()
\end{DoxyCompactItemize}
\subsection*{变量}
\begin{DoxyCompactItemize}
\item 
HOOK void($\ast$ \hyperlink{api_8h_ab2c6238f30c26c9f51730d30dbda2241}{RecvSms} )(const char $\ast$phonenum, const unsigned char $\ast$str)
\item 
HOOK void($\ast$ \hyperlink{api_8h_aac9a04f1f2cce3ef8bdafa7be0cabfea}{RecvWeChat} )(const char $\ast$from, const char $\ast$msg, EIResult\_\-t($\ast$relpy)(char $\ast$msg))
\item 
HOOK void($\ast$ \hyperlink{api_8h_a2076d1d25b16d2a7b125925d18f94272}{RecvTcpData} )(unsigned char $\ast$buffer, int size)
\item 
HOOK void($\ast$ \hyperlink{api_8h_ab222c70d87b7402f4ec44dba9c595ac9}{RecvP2pMsg} )(char $\ast$imei, char $\ast$msg)
\item 
HOOK void($\ast$ \hyperlink{api_8h_a4194f502aee2580f05acbcee83ff93de}{RecvXmppMsg} )(char $\ast$from, char $\ast$body)
\end{DoxyCompactItemize}


\subsection{详细描述}
EasyIO-\/GPRS 接口文件. 使用EasyIO Framework 需要引入此头文件，此文件包含了所有功能和方法的API函数和系统的钩子函数 \begin{DoxyAuthor}{作者}
stopfan 
\end{DoxyAuthor}
\begin{DoxyDate}{日期}
2013-\/11-\/11 
\end{DoxyDate}
\begin{DoxyVersion}{版本}
A001 
\end{DoxyVersion}
\begin{DoxyParagraph}{Copyright (c): }
新动力科技 
\end{DoxyParagraph}
\begin{DoxyParagraph}{History: }
version: stopfan, 2013-\/12-\/12, desc\par
 
\end{DoxyParagraph}


\subsection{宏定义文档}
\hypertarget{api_8h_a0044eb38af0014e6521a14a72d05a2f5}{
\index{api.h@{api.h}!EI\_\-FREE@{EI\_\-FREE}}
\index{EI\_\-FREE@{EI\_\-FREE}!api.h@{api.h}}
\subsubsection[{EI\_\-FREE}]{\setlength{\rightskip}{0pt plus 5cm}\#define EI\_\-FREE~rt\_\-free}}
\label{api_8h_a0044eb38af0014e6521a14a72d05a2f5}
定义 EI\_\-FREE \hypertarget{api_8h_afabb8cdc9450ec537c0bee641a9fda90}{
\index{api.h@{api.h}!EI\_\-MALLOC@{EI\_\-MALLOC}}
\index{EI\_\-MALLOC@{EI\_\-MALLOC}!api.h@{api.h}}
\subsubsection[{EI\_\-MALLOC}]{\setlength{\rightskip}{0pt plus 5cm}\#define EI\_\-MALLOC~rt\_\-malloc}}
\label{api_8h_afabb8cdc9450ec537c0bee641a9fda90}
定义 EI\_\-MALLOC \hypertarget{api_8h_a80a290edcdf5934b2bbda8eada5c3a52}{
\index{api.h@{api.h}!HOOK@{HOOK}}
\index{HOOK@{HOOK}!api.h@{api.h}}
\subsubsection[{HOOK}]{\setlength{\rightskip}{0pt plus 5cm}\#define HOOK}}
\label{api_8h_a80a290edcdf5934b2bbda8eada5c3a52}
不具备任何意义，只是作为前缀方面区分函数功能 \hypertarget{api_8h_aefb2aa75be4323fe06eb3ec8394bdfc7}{
\index{api.h@{api.h}!INTERFACE@{INTERFACE}}
\index{INTERFACE@{INTERFACE}!api.h@{api.h}}
\subsubsection[{INTERFACE}]{\setlength{\rightskip}{0pt plus 5cm}\#define INTERFACE~extern}}
\label{api_8h_aefb2aa75be4323fe06eb3ec8394bdfc7}
extern 

\subsection{函数文档}
\hypertarget{api_8h_a66cebdf06835f6d6b9c7ec77d84f7099}{
\index{api.h@{api.h}!GetLocation@{GetLocation}}
\index{GetLocation@{GetLocation}!api.h@{api.h}}
\subsubsection[{GetLocation}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t GetLocation ()}}
\label{api_8h_a66cebdf06835f6d6b9c7ec77d84f7099}
获取基站位置信息

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a3821ab5f141aaa49aa7da5f8caf3e580}{
\index{api.h@{api.h}!GetSysInfo@{GetSysInfo}}
\index{GetSysInfo@{GetSysInfo}!api.h@{api.h}}
\subsubsection[{GetSysInfo}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t GetSysInfo (struct {\bf SysInfo} $\ast$ {\em info})}}
\label{api_8h_a3821ab5f141aaa49aa7da5f8caf3e580}
获取系统信息

param\mbox{[}out\mbox{]} info : 输出系统信息结构体 \begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_acb3f64b85678bbeaad49e856e894d6ad}{
\index{api.h@{api.h}!HttpRequest@{HttpRequest}}
\index{HttpRequest@{HttpRequest}!api.h@{api.h}}
\subsubsection[{HttpRequest}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE int HttpRequest (const char $\ast$ {\em url}, \/  const char $\ast$ {\em UserHeader}, \/  char $\ast$ {\em RespBuffer}, \/  int {\em RespBufSize})}}
\label{api_8h_acb3f64b85678bbeaad49e856e894d6ad}
发起HTTP请求，目前仅支持GET请求


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em url}]: 要请求的URL \item[\mbox{$\leftarrow$} {\em Userheader}]：用户字定义请求头，一般为 NULL \item[\mbox{$\leftarrow$} {\em RespBuffer}]: HTTP请求的返回结果保存在此缓冲中 \item[\mbox{$\leftarrow$} {\em RespBufSize,:}]HTTP缓冲的大小 \end{DoxyParams}
\begin{DoxyReturn}{返回}
返回真正获取到的数据长度 返回“0代表”失败 
\end{DoxyReturn}
\hypertarget{api_8h_a951592d1b14d7bebd76b61fa3f670b88}{
\index{api.h@{api.h}!InitBoard@{InitBoard}}
\index{InitBoard@{InitBoard}!api.h@{api.h}}
\subsubsection[{InitBoard}]{\setlength{\rightskip}{0pt plus 5cm}void InitBoard ()}}
\label{api_8h_a951592d1b14d7bebd76b61fa3f670b88}
硬件初始化

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a009e64f475ff55b9627e9705d8d3c590}{
\index{api.h@{api.h}!InitDtu@{InitDtu}}
\index{InitDtu@{InitDtu}!api.h@{api.h}}
\subsubsection[{InitDtu}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t InitDtu (struct {\bf DtuOption} $\ast$ {\em option})}}
\label{api_8h_a009e64f475ff55b9627e9705d8d3c590}
初始化Dtu


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em option}]: Dtu参数\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a5ab96a061e08adee4a93aca4e050257c}{
\index{api.h@{api.h}!InitEasyIOCloud@{InitEasyIOCloud}}
\index{InitEasyIOCloud@{InitEasyIOCloud}!api.h@{api.h}}
\subsubsection[{InitEasyIOCloud}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t InitEasyIOCloud ()}}
\label{api_8h_a5ab96a061e08adee4a93aca4e050257c}
初始化EasyIO云,初始化此功能后，可使用微信，Web，手机等 设备与设备进行通讯

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a4b93413c1716a933b70ff024609531f9}{
\index{api.h@{api.h}!InitSerial@{InitSerial}}
\index{InitSerial@{InitSerial}!api.h@{api.h}}
\subsubsection[{InitSerial}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t InitSerial (struct {\bf SerialOption} $\ast$ {\em option})}}
\label{api_8h_a4b93413c1716a933b70ff024609531f9}
初始化串口


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em option}]: 串口参数\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a6c87ac370cc3c561d7bc5fc4527dc627}{
\index{api.h@{api.h}!InitXmpp@{InitXmpp}}
\index{InitXmpp@{InitXmpp}!api.h@{api.h}}
\subsubsection[{InitXmpp}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t InitXmpp (struct {\bf XmppOption} $\ast$ {\em option})}}
\label{api_8h_a6c87ac370cc3c561d7bc5fc4527dc627}
初始化Xmpp客户端


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em option}]: Xmpp服务器参数\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a153a5fd8946b6ab9fd9b725759fffe5e}{
\index{api.h@{api.h}!MainLoop@{MainLoop}}
\index{MainLoop@{MainLoop}!api.h@{api.h}}
\subsubsection[{MainLoop}]{\setlength{\rightskip}{0pt plus 5cm}void MainLoop ()}}
\label{api_8h_a153a5fd8946b6ab9fd9b725759fffe5e}
主循环,一切从这里开始... $|$ 主循环最大使用的栈空间为1Kbyte 请尽量多的使用(EI\_\-MALLOC/EI\_\-FREE)动态使用内存分配

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_acfa681e48122da0da490adb8b19d8ece}{
\index{api.h@{api.h}!ReadEEPROM@{ReadEEPROM}}
\index{ReadEEPROM@{ReadEEPROM}!api.h@{api.h}}
\subsubsection[{ReadEEPROM}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t ReadEEPROM (int {\em pos}, \/  unsigned char $\ast$ {\em buffer}, \/  int {\em size})}}
\label{api_8h_acfa681e48122da0da490adb8b19d8ece}
读取EEPROM中的内容


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em pos}]: 要读取的位置 \item[\mbox{$\rightarrow$} {\em buffer}]: 存储读出内容的缓冲 \item[\mbox{$\leftarrow$} {\em size}]: 读取长度\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a59df66cde845e58fbcce79eafb42b5ee}{
\index{api.h@{api.h}!ReadSerial@{ReadSerial}}
\index{ReadSerial@{ReadSerial}!api.h@{api.h}}
\subsubsection[{ReadSerial}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE int ReadSerial (unsigned char $\ast$ {\em buffer}, \/  int {\em max}, \/  int {\em timeout})}}
\label{api_8h_a59df66cde845e58fbcce79eafb42b5ee}
读取串口数据


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em max}]: 读取缓冲的长度 \item[\mbox{$\rightarrow$} {\em buffer}]: 存储读出内容的缓冲 \item[\mbox{$\leftarrow$} {\em timeout}]: 超时等待 ，最小时间间隔为百分之一秒\end{DoxyParams}
\begin{DoxyReturn}{返回}
int 返回读取出的数据长度 -\/1 为读取错误 
\end{DoxyReturn}
\hypertarget{api_8h_a0e1c8e962bd88c2df5fb6a54865545a6}{
\index{api.h@{api.h}!ResetGprs@{ResetGprs}}
\index{ResetGprs@{ResetGprs}!api.h@{api.h}}
\subsubsection[{ResetGprs}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t ResetGprs ()}}
\label{api_8h_a0e1c8e962bd88c2df5fb6a54865545a6}
GPRS 模块重启 ,只针对 gprs 模块进行复位重启

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a2a69f03277a975ab59fb363b54e8942c}{
\index{api.h@{api.h}!ResetSystem@{ResetSystem}}
\index{ResetSystem@{ResetSystem}!api.h@{api.h}}
\subsubsection[{ResetSystem}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t ResetSystem ()}}
\label{api_8h_a2a69f03277a975ab59fb363b54e8942c}
设备重启 ,执行此函数后，模块和MCU都将重启

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a6f4a24bbde5f08822dacb0e5fca2acae}{
\index{api.h@{api.h}!SendP2paMsg@{SendP2paMsg}}
\index{SendP2paMsg@{SendP2paMsg}!api.h@{api.h}}
\subsubsection[{SendP2paMsg}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t SendP2paMsg (const char $\ast$ {\em imei}, \/  const char $\ast$ {\em body})}}
\label{api_8h_a6f4a24bbde5f08822dacb0e5fca2acae}
发送P2p消息


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em imei}]: 目的IMEI \item[\mbox{$\leftarrow$} {\em body}]：内容\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a7f277cbc25c344a82fb50c809fb3ca3b}{
\index{api.h@{api.h}!SendSms@{SendSms}}
\index{SendSms@{SendSms}!api.h@{api.h}}
\subsubsection[{SendSms}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t SendSms (const char $\ast$ {\em phonenum}, \/  const char $\ast$ {\em body})}}
\label{api_8h_a7f277cbc25c344a82fb50c809fb3ca3b}
发送短信


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em phonenum}]: 目标手机号码 \item[\mbox{$\leftarrow$} {\em body}]: 发送内容\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a4c362ba910ffadc54d3d7b0d95bf9b94}{
\index{api.h@{api.h}!SendTcpData@{SendTcpData}}
\index{SendTcpData@{SendTcpData}!api.h@{api.h}}
\subsubsection[{SendTcpData}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t SendTcpData (const char $\ast$ {\em buffer}, \/  int {\em size})}}
\label{api_8h_a4c362ba910ffadc54d3d7b0d95bf9b94}
发DTU送数据


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em buffer}]: 发送缓冲 \item[\mbox{$\leftarrow$} {\em size}]: 发送长度\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a1b26a329aa3aa5e962809722a37e21f6}{
\index{api.h@{api.h}!SendXmppMsg@{SendXmppMsg}}
\index{SendXmppMsg@{SendXmppMsg}!api.h@{api.h}}
\subsubsection[{SendXmppMsg}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t SendXmppMsg (const char $\ast$ {\em to}, \/  const char $\ast$ {\em body})}}
\label{api_8h_a1b26a329aa3aa5e962809722a37e21f6}
发送XMPP消息


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em to}]: 目的ID \item[\mbox{$\leftarrow$} {\em body}]：内容\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a78cc5c993ce3e0c72ddc38c7de1b6d83}{
\index{api.h@{api.h}!SerialPrintf@{SerialPrintf}}
\index{SerialPrintf@{SerialPrintf}!api.h@{api.h}}
\subsubsection[{SerialPrintf}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE int SerialPrintf (char $\ast$ {\em fmt}, \/   {\em ...})}}
\label{api_8h_a78cc5c993ce3e0c72ddc38c7de1b6d83}
格式化输出字符串到串口


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em fmt}]: 格式化字符串\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a567fcfb601dc83cc9691ce515ce5a474}{
\index{api.h@{api.h}!Startup@{Startup}}
\index{Startup@{Startup}!api.h@{api.h}}
\subsubsection[{Startup}]{\setlength{\rightskip}{0pt plus 5cm}void Startup ()}}
\label{api_8h_a567fcfb601dc83cc9691ce515ce5a474}
启动函数，EasyIO 启动时将调用此函数,系统相关的初始化和回调函数注册需要在这里进行。

\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a59935c90d54edd81607ba01ed7d02957}{
\index{api.h@{api.h}!WriteEEPROM@{WriteEEPROM}}
\index{WriteEEPROM@{WriteEEPROM}!api.h@{api.h}}
\subsubsection[{WriteEEPROM}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t WriteEEPROM (int {\em pos}, \/  unsigned char $\ast$ {\em buffer}, \/  int {\em size})}}
\label{api_8h_a59935c90d54edd81607ba01ed7d02957}
将内容写入EEPROM


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em pos}]: 要写入的位置 \item[\mbox{$\rightarrow$} {\em buffer}]: 写入缓冲 \item[\mbox{$\leftarrow$} {\em size}]: 写入长度\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a1a7008f48872b20f41bd83290e4705e5}{
\index{api.h@{api.h}!WriteSerial@{WriteSerial}}
\index{WriteSerial@{WriteSerial}!api.h@{api.h}}
\subsubsection[{WriteSerial}]{\setlength{\rightskip}{0pt plus 5cm}INTERFACE EIResult\_\-t WriteSerial (unsigned char $\ast$ {\em buffer}, \/  int {\em size})}}
\label{api_8h_a1a7008f48872b20f41bd83290e4705e5}
将内容写入串口


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em buffer}]: 写入缓冲 \item[\mbox{$\leftarrow$} {\em size}]: 写入长度\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}


\subsection{变量文档}
\hypertarget{api_8h_ab222c70d87b7402f4ec44dba9c595ac9}{
\index{api.h@{api.h}!RecvP2pMsg@{RecvP2pMsg}}
\index{RecvP2pMsg@{RecvP2pMsg}!api.h@{api.h}}
\subsubsection[{RecvP2pMsg}]{\setlength{\rightskip}{0pt plus 5cm}HOOK void($\ast$ {\bf RecvP2pMsg})(char $\ast$imei, char $\ast$msg)}}
\label{api_8h_ab222c70d87b7402f4ec44dba9c595ac9}
接收P2p消息


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em imei}]: 发送者IMEI \item[\mbox{$\leftarrow$} {\em body}]：接收内容\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_ab2c6238f30c26c9f51730d30dbda2241}{
\index{api.h@{api.h}!RecvSms@{RecvSms}}
\index{RecvSms@{RecvSms}!api.h@{api.h}}
\subsubsection[{RecvSms}]{\setlength{\rightskip}{0pt plus 5cm}HOOK void($\ast$ {\bf RecvSms})(const char $\ast$phonenum, const unsigned char $\ast$str)}}
\label{api_8h_ab2c6238f30c26c9f51730d30dbda2241}
接收到短信的回调函数


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em phonenum}]: 电话号码 \item[\mbox{$\leftarrow$} {\em str}]: 短信内容\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a2076d1d25b16d2a7b125925d18f94272}{
\index{api.h@{api.h}!RecvTcpData@{RecvTcpData}}
\index{RecvTcpData@{RecvTcpData}!api.h@{api.h}}
\subsubsection[{RecvTcpData}]{\setlength{\rightskip}{0pt plus 5cm}HOOK void($\ast$ {\bf RecvTcpData})(unsigned char $\ast$buffer, int size)}}
\label{api_8h_a2076d1d25b16d2a7b125925d18f94272}
接收到Tcp数据的回调函数


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em buffer}]: 数据缓冲 \item[\mbox{$\leftarrow$} {\em size}]: 数据长度\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_aac9a04f1f2cce3ef8bdafa7be0cabfea}{
\index{api.h@{api.h}!RecvWeChat@{RecvWeChat}}
\index{RecvWeChat@{RecvWeChat}!api.h@{api.h}}
\subsubsection[{RecvWeChat}]{\setlength{\rightskip}{0pt plus 5cm}HOOK void($\ast$ {\bf RecvWeChat})(const char $\ast$from, const char $\ast$msg, EIResult\_\-t($\ast$relpy)(char $\ast$msg))}}
\label{api_8h_aac9a04f1f2cce3ef8bdafa7be0cabfea}
接收到微信的回调函数


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em from}]: 发送者的微信Id \item[\mbox{$\leftarrow$} {\em msg}]: 信息内容 \item[\mbox{$\leftarrow$} {\em relpy}]: 回复本条微信的函数\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\hypertarget{api_8h_a4194f502aee2580f05acbcee83ff93de}{
\index{api.h@{api.h}!RecvXmppMsg@{RecvXmppMsg}}
\index{RecvXmppMsg@{RecvXmppMsg}!api.h@{api.h}}
\subsubsection[{RecvXmppMsg}]{\setlength{\rightskip}{0pt plus 5cm}HOOK void($\ast$ {\bf RecvXmppMsg})(char $\ast$from, char $\ast$body)}}
\label{api_8h_a4194f502aee2580f05acbcee83ff93de}
接受XMPP消息的回调函数


\begin{DoxyParams}{参数}
\item[\mbox{$\leftarrow$} {\em from}]: 发送者ID \item[\mbox{$\leftarrow$} {\em body}]：接收内容\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
